﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel;

namespace Sky.Web.Models
{
    //专辑
    [Bind(Exclude = "AlbumId")]
    public class Album
    {
        [ScaffoldColumn(false)] 
        public int AlbumId { get; set; }

        public int GenreId { get; set; }      
        public int ArtistId { get; set; }
        [Required(ErrorMessage = "专辑名称必填")]
        [StringLength(160)]
        public string Title { get; set; }
        [Range(0.01, 100.00,
        ErrorMessage = "价格必须介于 0.01 与 100.00之间")]
        public decimal Price { get; set; }
        [DisplayName("专辑地址")]
        [StringLength(1024)]
        public string AlbumArtUrl { get; set; }       

        //延迟加载
        public virtual Genre Genre { get; set; }       
        public virtual Artist Artist { get; set; }
        
        //增加首页热门专辑
        public virtual List<OrderDetail> OrderDetails { get; set; }
    }
}